package com.zoght.financial.model;

import java.util.Date;

public class TransactionBean {

	public static enum Type {
	   Buy,
	   Sell,
	   Interest,
	   Dividend,
	   TelephoneBanking,
	};
	
	public static enum Currency {
		USD,
		CAD
	};
	private Date transactionDate, settlemenDate;
	private String symbol, description;
	private int units;
	private double total, pricePerUnit;
	private Type type;
	private Currency currency = Currency.CAD;
	
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append(symbol + "\t");
		builder.append(transactionDate.toGMTString() + "\t");
		builder.append(type + "\t");
		if (units != Integer.MAX_VALUE) {
			builder.append(units + "\t");
		}
		if (pricePerUnit != Double.MAX_VALUE) {
			builder.append(pricePerUnit + "\n");
		}		
		if (total != Double.MAX_VALUE) {
			builder.append(total + "\n");
		}
		return builder.toString();
	}
	
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}
	public Currency getCurrency() {
		return currency;
	}
	public void setCurrency(Currency currency) {
		this.currency = currency;
	}
	public Date getTransactionDate() {
		return transactionDate;
	}
	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}
	public Date getSettlemenDate() {
		return settlemenDate;
	}
	public void setSettlemenDate(Date settlemenDate) {
		this.settlemenDate = settlemenDate;
	}
	public String getSymbol() {
		return symbol;
	}
	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public int getUnits() {
		return units;
	}
	public void setUnits(int units) {
		this.units = units;
	}
	public double getTotal() {
		return total;
	}
	public void setTotal(double total) {
		this.total = total;
	}
	public double getPricePerUnit() {
		return pricePerUnit;
	}
	public void setPricePerUnit(double pricePerUnit) {
		this.pricePerUnit = pricePerUnit;
	}
	
	
	
}
